package com.zch.starter.sentinel.springboot.starter.properties;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * 使用@ConfigurationProperties 的好处是 在业务项目中可以提示配置项 也可以跳转到配置项代码中
 */
@ConfigurationProperties(prefix = "sentinel")
@Data
public class SentinelNacosAutoConfigProperties {
    @Data
    public static class Nacos {
        private String serverAddress;
        private String namespace;
        private String dataId;
        private String type;
        private String groupId;
        private String username;
        private String password;
    }
    private Nacos nacos = new Nacos();
    @Data
    public static class Client {
        private String appName;

    }
    private Client client = new Client();
    @Data
    public static class Dashboard {
        private String serverAddress;

    }
    private Dashboard dashboard = new Dashboard();

    private Autoconfig autoconfig = new Autoconfig();

    public static class Autoconfig {
        private boolean enabled = false; // 默认值为 false

        // Getter 和 Setter
        public boolean isEnabled() {
            return enabled;
        }

        public void setEnabled(boolean enabled) {
            this.enabled = enabled;
        }
    }

    // Getter 和 Setter
    public Autoconfig getAutoconfig() {
        return autoconfig;
    }

    public void setAutoconfig(Autoconfig autoconfig) {
        this.autoconfig = autoconfig;
    }

    public Client getClient() {
        return client;
    }

    public void setClient(Client client) {
        this.client = client;
    }

    public Nacos getNacos() {
        return nacos;
    }

    public void setNacos(Nacos nacos) {
        this.nacos = nacos;
    }
}